Microsoft .NET Framework SDK QuickStart Configuration Details

This page provides a detailed listing of the configuration steps performed by the .NET Framework QuickStart configuration program.  It also contains solutions to common problems related to the samples setup.

 

General SQL Server/MSDE Information

In order for the database access samples to function properly, a named instance of Microsoft SQL Server 2000 Desktop Engine (MSDE) is required.  To download and install the Microsoft SQL Server 2000 Desktop Engine, please follow the instructions on the Microsoft .NET Framework SDK MSDE help page. 

The MSDE instance name used by the SDK samples is 'NetSDK'.  To access the database, use the server name: (local)\NetSDK.


Adding the SQL Server Databases to SQL Server

Four databases are used throughout the QuickStarts: The two SQL demo databases: Pubs and NorthWind; And two custom databases: GrocerToGo and Portal.  The SQL scripts to install these database are provided in the <SDK>\Samples\Setup directory.  To manually install these four databases, run the following commands from the command line.  Note: The path to the osql.exe command must be located in your PATH environment variable.

osql -E -S (local)\NetSDK -i InstPubs.sql
osql -E -S (local)\NetSDK -i InstNwnd.sql
osql -E -S (local)\NetSDK -i Portal.sql
osql -E -S (local)\NetSDK -i Grocer.sql
 


Granting Access to the ASPNET user

The ASP.NET process runs under a specific account.  In order for the data access samples to access the database, this account must be granted rights to the sample databases.  If the operating system is part of the Windows Server 2003 family the ASP.NET process runs under NT AUTHORITY\NETWORK SERVICE account. In all other cases it runs under MACHINENAME\ASPNET account.
To manually grant access to the ASPNET user run the following commands from the command line.

  • For Windows Server 2003 family systems running IIS 6.0 replace <ASP.NET User Account> with 'NT AUTHORITY\NETWORK SERVICE' in the following commands.
  • For all other cases replace <ASP.NET User Account> with 'MACHINENAME\ASPNET' where MACHINENAME is the name of your computer.

osql -E -S (local)\NetSDK -Q "sp_grantlogin <ASP.NET User Account>"

osql -E -S (local)\NetSDK -d Pubs -Q "sp_grantdbaccess <ASP.NET User Account>"
osql -E -S (local)\NetSDK -d Pubs -Q "sp_addrolemember 'db_owner', <ASP.NET User Account>"

osql -E -S (local)\NetSDK -d NorthWind -Q "sp_grantdbaccess <ASP.NET User Account>"
osql -E -S (local)\NetSDK -d NorthWind -Q "sp_addrolemember 'db_owner', <ASP.NET User Account>"

osql -E -S (local)\NetSDK -d Portal -Q "sp_grantdbaccess <ASP.NET User Account>"
osql -E -S (local)\NetSDK -d Portal -Q "sp_addrolemember 'db_owner', <ASP.NET User Account>"

osql -E -S (local)\NetSDK -d GrocerToGo -Q "sp_grantdbaccess <ASP.NET User Account>"
osql -E -S (local)\NetSDK -d GrocerToGo -Q "sp_addrolemember 'db_owner', <ASP.NET User Account>"
 

Note: The path to the osql.exe command must be located in your PATH environment variable.

Starting MSDE

The QuickStart Tutorials that demonstrate database access require that MSDE is started.  If MSDE is stopped, most samples will throw a, "Timeout expired" or "SQL Sever does not exist or access denied" error.  To start MSDE:

  1. From the command line, type:

      net start MSSQL$NetSDK

Pre-Existing Data Files

If database files with the same filename already exist on the hard drive, the samples configuration utility will not overwrite/replace these files.  There are two ways to correct this problem:

1.  Delete or rename the following files from the C:\Program Files\Microsoft SQL Server\MSSQL$NetSDK\Data directory.
  • Pubs.mdf
  • Pubs_log.ldf
  • northwind.mdf
  • northwind.ldf
  • GrocerToGo.mdf
  • GrocerToGo.ldf
  • Portal.mdf
  • Portal_log.ldf

2a.  Complete the instructions outlined in the Adding the SQL Server Databases to SQL Server and Granting Access to the ASPNET user sections above.
2b.  Or, run the samples configuration utility again.
 

Modifying Web.Config

Modify the sourceview node of the Web.Config file in the QuickStart subdirectory to reflect the samples installation directory.

    . . .
    <sourceview>
        <add key="root" value="C:\Program Files\Microsoft.NET\SDK\v1.1\QuickStart" />
    </sourceview>
    . . .
     

Setting the NetSamplePath Environment Variable

The NetSamplePath environment variable is required to compile the QuickStart samples.  Set the NetSamplePath environment variable to <SDK> directory.  The <SDK> directory name must be in the short form (no spaces).  For an example of what NetSamplePath should be set to, see the SDKVars.bat file located in the <SDK>\Bin directory.

The process of setting an environment variable varies depending on your operating system.  In general, the command is:

    SET NetSamplePath=D:\PROGRA~1\MICROS~1.NET\SDK\v1.1\
     

Compiling the QuickStarts

Most of the QuickStart tutorials are shipped with compiled exe's and dll's.  However, there are a few samples that require compilation on the local computer.  Specifically, these are samples that register components, install assemblies into the Global Assembly Cache, or demonstrate COM Interop.  To compile these samples, run the Register.bat command located in the <SDK>\QuickStart directory. 
 

Installing IIS and ASP.NET

The QuickStart tutorials are written in ASP.NET and require IIS.  If IIS was not installed prior to installing the SDK, ASP.NET pages will not display properly.  To install IIS and ASP.NET, complete the following steps:

  1. From the Add/Remove Programs applet in the Windows Control Panel, select Add/Remove Windows Components. 
    Select Internet Information Services and complete the installation process.
     
  2. From the command line, navigate to the .NET version directory.  For example:
        C:\Winnt\Microsoft.NET\Framework\v1.0.XXXX
     
  3. Run the following command:
        aspnet_regiis.exe -i
     
  4. Run the following command:
        iisreset.exe
     
  5. Return to the StartSamples.htm page and re-run the QuickStart setup.
     

Creating the IIS Virtual Directories

The QuickStart configuration program creates several IIS virtual directories/web applications.  If you would like to manually create these, a complete list is provided below. The paths for the virtual directories all stem from the <SDK> directory. 

For example:
C:\Program Files\Microsoft.NET\SDK\v1.1\QuickStart

All the virtual roots/web applications are created with IIS IP security restrictions.  You will only be able to browse the virtual directories via localhost (i.e. http://localhost/quickstart).  To turn off this restriction, modify the virtual directory's IP Security property in Internet Services Manager.  Note:  Windows 2000/XP Professional users, this functionality is disabled in Internet Services Manager.  Use the WebIPSetting.exe tool located in the <SDK>\Samples\Setup\Tools folder to reset your IP security settings.

    Virtual Directories
    QuickStart
    MobileQuickStart

    Web Applications
    QuickStart\ASPPlus
    QuickStart\WinForms
    QuickStart\HowTo
    QuickStart\ASPPlus\Samples\grocertogo\CS
    QuickStart\ASPPlus\Samples\grocertogo\VB
    QuickStart\ASPPlus\Samples\grocertogo\JS
    QuickStart\ASPPlus\Samples\portal\CS
    QuickStart\ASPPlus\Samples\portal\VB
    QuickStart\ASPPlus\Samples\portal\JS
    QuickStart\ASPPlus\Samples\apps\application1\CS
    QuickStart\ASPPlus\Samples\apps\application1\JS
    QuickStart\ASPPlus\Samples\apps\application1\VB
    QuickStart\ASPPlus\Samples\apps\application2\JS
    QuickStart\ASPPlus\Samples\apps\application2\CS
    QuickStart\ASPPlus\Samples\apps\application2\VB
    QuickStart\ASPPlus\Samples\apps\session1\CS
    QuickStart\ASPPlus\Samples\apps\session1\JS
    QuickStart\ASPPlus\Samples\apps\session1\VB
    QuickStart\ASPPlus\Samples\security\cookieauth\CS
    QuickStart\ASPPlus\Samples\security\cookieauth\VB
    QuickStart\ASPPlus\Samples\security\cookieauth\JS
    QuickStart\ASPPlus\Samples\security\userauth\CS
    QuickStart\ASPPlus\Samples\security\userauth\VB
    QuickStart\ASPPlus\Samples\security\userauth\JS
    QuickStart\ASPPlus\Samples\security\windowsauth\CS
    QuickStart\ASPPlus\Samples\security\windowsauth\VB
    QuickStart\ASPPlus\Samples\security\windowsauth\JS
    QuickStart\ASPPlus\Samples\localize\resources
    QuickStart\ASPPlus\Samples\localize\resources\News\CS
    QuickStart\ASPPlus\Samples\localize\resources\News\VB
    QuickStart\ASPPlus\Samples\localize\resources\News\JS
    QuickStart\ASPPlus\Samples\vstudio\security\cookieauth\CS
    QuickStart\ASPPlus\Samples\vstudio\security\cookieauth\VB
    QuickStart\ASPPlus\Samples\vstudio\services\dataservice\CS
    QuickStart\ASPPlus\Samples\vstudio\services\dataservice\VB
    QuickStart\ASPPlus\Samples\vstudio\services\datatypes\CS
    QuickStart\ASPPlus\Samples\vstudio\services\datatypes\VB
    QuickStart\ASPPlus\Samples\vstudio\services\intrinsics\CS
    QuickStart\ASPPlus\Samples\vstudio\services\intrinsics\VB
    QuickStart\ASPPlus\Samples\vstudio\services\mathservice\CS
    QuickStart\ASPPlus\Samples\vstudio\services\mathservice\VB
    QuickStart\ASPPlus\Samples\vstudio\webforms\customize\CS
    QuickStart\ASPPlus\Samples\vstudio\webforms\customize\VB
    QuickStart\ASPPlus\Samples\vstudio\webforms\data\CS
    QuickStart\ASPPlus\Samples\vstudio\webforms\data\VB
    QuickStart\ASPPlus\Samples\vstudio\webforms\pagelets\CS
    QuickStart\ASPPlus\Samples\vstudio\webforms\pagelets\VB
    QuickStart\ASPPlus\Samples\vstudio\webforms\validate\CS
    QuickStart\ASPPlus\Samples\vstudio\webforms\validate\VB
    QuickStart\WinForms\Samples\Data\MasterDetails\CS
    QuickStart\WinForms\Samples\Data\MasterDetails\VB
    QuickStart\WinForms\Samples\Data\Update\CS
    QuickStart\WinForms\Samples\Data\Update\VB
    QuickStart\WinForms\Samples\Data\WebServiceBinding\CS
    QuickStart\WinForms\Samples\Data\WebServiceBinding\VB
    MobileQuickStart\samples\security\VB
    MobileQuickStart\samples\security\CS
    MobileQuickStart\samples\security\JS


Removing the IIS Virtual Directories

Uninstalling the SDK will not remove the IIS Virtual Directories created by the Samples Configuration Tool.  To remove the virtual directories, complete the following steps:

  1. Open the Administrative Tools folder in the Windows Control Panel.
  2. Open the Internet Services Manager
  3. Locate the QuickStart virtual directory in the default web site.
  4. Delete the virtual directory.
  5. Locate the MobileQuickStart virtual directory in the default web site.
  6. Delete the virtual directory.

Switching Between the v1.0 and v1.1 QuickStarts

Because the v1.0 and v1.1 QuickStarts share the same IIS Virtual Directory, they can not be run concurrently (side-by-side).  To switch between the v1.0 and the v1.1 QuickStarts, perform the following steps:

The example below presumes switching FROM v1.1 TO v1.0.

  1. Locate the path to QuickStart files you wish to switch to (v1.0).  i.e.  C:\Program Files\Microsoft.NET\FrameworkSDK\Samples\QuickStart.
     
  2. Set the NETSAMPLEPATH environment variable to the QuickStart root directory.  The path provided must be in the short (8.3) format. 

    NOTE:  The following command sets the NETSAMPLEPATH environment variable for the current console session only.  To preserve this environment variable setting, set NETSAMPLEPATH via My Computer.

        
    For Example:
        
    SET NETSAMPLEPATH=C:\Progra~1\Microsoft.NET\FrameworkSDK\Samples\
     
  3. Re-map the IIS virtual directories by running ConfigSamples.exe from the …\Samples\Setup directory.

         For Example:
        
    C:\Program Files\Microsoft.NET\FrameworkSDK\Samples\Setup> ConfigSamples.exe
     
  4. Locate the path to the .NET Framework version directory that corresponds to the version of the QuickStarts you are switching to.

    For Example:  C:\Windows\Microsoft.NET\Framework\v1.0.3705
     
  5. Install this version ASP.NET to the QuickStart IIS virtual directories by running the following command: aspnet_regiis.exe -s W3SVC/1/ROOT/QuickStart

         For Example:
        
    C:\Windows\Microsoft.NET\Framework\v1.0.3705> aspnet_regiis.exe -s W3SVC/1/ROOT/QuickStart

If you have installed the v1.0 version of the Microsoft Mobile Internet Toolkit (MMIT) QuickStarts and want to switch to the v1.0 MMIT QuickStarts, follow the following steps:

  1. Manually re-map the 'MobileQuickStart' IIS virtual directory to the v1.0 MMIT QuickStarts using the Internet Information Services Manager (inetmgr.exe). 
     
  2. From the .NET Framework version directory (see Step 3 above), run the following command:

    aspnet_regiis.exe -s W3SVC/1/ROOT/MobileQuickStart

Running the QuickStarts on the Windows Server 2003 family

Note: If you are installing the QuickStarts on a Windows Server 2003 family machine, ASP.NET Web Server Extensions must be 'Allowed' for the QuickStarts to work. See the 'Enabling and Disabling Dynamic Content' section of the IIS help documentation for more information.

Installing Additional Fonts

The ASP.NET Quickstart Localization samples require several fonts (e.g. Japanese) to view the samples correctly.  The installation procedure for these fonts may require the original Windows CD. To install new fonts, complete the following steps:

On Windows 2000

  • Open Control Panel
  • Open Regional Options / General
  • Check the desired language setting in the 'Language setting for the system' listbox. e.g. Japanese (additional languages can be selected at this point as well)

On Windows XP

  • Open Control Panel
  • Open Regional and Language Options
  • Select Languages tab
  • Check the desired language setting.  e.g. 'Install files for East Asian Languages'

Copyright © 2002 Microsoft Corporation. All rights reserved.